package com.lie.think.c5;

/**
 * Created by lie on 2018/4/4.
 * 构造与初始化
 *
 * 结论之一：成员变量，自动初始化比构造早
 * @see #c 所以c的值是先变成null，再变成C的
 */
public class P5_1 {
    //不显示赋值
    public String a;
    //定义时就被初始化
    public String b = "b";
    //通过构造来初始化
    public String c;


    public P5_1(String c) {
        System.out.println("a = "+ this.a);
        System.out.println("b = "+ this.b);
        System.out.println("c = "+ this.c);
        System.out.println("d = "+ this.d);

        this.c = c;
    }

    public String d = "d";

    public static void main(String[] args){
//        a = null
//        b = b
//        c = null
//        d = d
        new P5_1("C");
    }
}
